//
//  TopicListView.m
//  Leisure
//
//  Created by xalo on 16/7/2.
//  Copyright © 2016年 朱旭东. All rights reserved.
//

#import "TopicListView.h"

@interface TopicListView ()
@property(nonatomic,strong)UIWebView *webView;
@end

@implementation TopicListView

- (UIWebView *)webView
{
    if (!_webView) {
        _webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    }
    return _webView;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.webView];
    
    //数据请求
    self.view.backgroundColor = [UIColor  cyanColor];
    
    [RequestManager fetchDataWithURL:kTopicListUrl  parameters:@{@"contentid":self.contentID} method:@"POST" complet:^(NSData *data) {
        NSDictionary *bigDic =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
        
        NSLog(@"%@",bigDic);
        
        NSString *str = bigDic[@"data"][@"postsinfo"][@"shareinfo"][@"url"];
        [self.webView  loadRequest:[NSURLRequest  requestWithURL:[NSURL  URLWithString:str]]];
        
    } updataUI:^{
        
    }];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
